#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton *button = new QPushButton(this);
    button->setText("按钮");
    button->move(300, 300);
//    QPushButton *button2 = new QPushButton(this);
//    button->setText("发射");
//    button->move(500, 500);
    connect(button, &QPushButton::clicked, this, &Widget::handle);
    connect(this, &Widget::mySignal, this, &Widget::handle2);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handle()
{
    QString str1("参数1");
    emit mySignal(str1);

}
void Widget::handle2(QString str)
{
    setWindowTitle(str);

}


void Widget::on_pushButton_clicked()
{
    QRect rect = ui->label->geometry();
}
